package com.kaluli.project.repository.impl;

import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.http.client.utils.DateUtils;
import org.springframework.stereotype.Repository;

import com.kaluli.project.domain.entity.CpsVO;
import com.kaluli.project.domain.entity.KllMq;
import com.kaluli.project.domain.entity.KllMqBak;
import com.kaluli.project.domain.entity.KllUser;
import com.kaluli.project.domain.repository.KllMqRepository;
import com.kaluli.project.domain.repository.KllUserRepository;
import com.kaluli.project.utils.DateOprator;
import com.kaluli.project.utils.DateUtil;
import com.kaluli.system.repository.AbstractRepositorySupport;

@Repository
public class KllUserRepositoryImpl extends AbstractRepositorySupport<KllUser>
		implements KllUserRepository{

	
	

	@Override
	public KllUser findByUserId(String userId) {
		KllUser user = null;
		StringBuffer hql=new StringBuffer(" from KllUser t where t.userId=:user_id ");
		Map<String,Object> params=new HashMap<String, Object>();
		params.put("user_id", userId);
		List<KllUser> lists =  this.findHqlForMap(hql.toString(), params);
		if(lists!=null&&lists.size()>0){
			user = lists.get(0);
		}
		
		return user;
	}

	@Override
	protected Class<KllUser> getEntityClass() {
		// TODO Auto-generated method stub
		return KllUser.class;
	}

}
